import request from '@/utils/request'

export default {
  /**
   * 分页/高级查询查询讲师
   * @param current 当前页
   * @param limit 大小
   * @param query 高级查询参数
   * @returns {*}
   */
  queryEduTeacher(current, limit, query) {
    return request({
      url: `/edu-service/teacher/pageCondition/${current}/${limit}`,
      method: 'post',
      data: query
    })
  },
  /**
   * 查询所有讲师
   */
  queryAllTeacher() {
    return request({
      url: `/edu-service/teacher/all`,
      method: 'get'
    })
  },
  /**
   * 根据id查询讲师
   * @param id 讲师id
   * @returns {*}
   */
  findById(id) {
    return request({
      url: `/edu-service/teacher/findById/${id}`,
      method: 'get',
    })
  },
  /**
   * 根据id删除讲师
   * @param id 讲师id
   * @returns {*}
   */
  deleteById(id) {
    return request({
      url: `/edu-service/teacher/${id}`,
      method: 'delete'
    })
  },
  /**
   * 添加讲师
   * @param data 数据
   * @returns {*}
   */
  addTeacher(data) {
    return request({
      url: `/edu-service/teacher/add`,
      method: 'post',
      data
    })
  },
  /**
   * 更新讲师信息
   * @param data
   * @returns {*}
   */
  updateTeacher(data) {
    return request({
      url: `/edu-service/teacher/updateTeacher`,
      method: 'post',
      data
    })
  },
  /**
   * 查询所有课程分类信息
   */
  subjectList() {
    return request({
      url: `/edu-service/subject/all`,
      method: 'get'
    })
  },
  /**
   * 根据pid查询课程分类信息
   * @param pid
   * @returns {*}
   */
  querySubjectByPid(pid) {
    return request({
      url: `/edu-service/subject/queryByPid/${pid}`,
      method: 'get'
    })
  },
  /**
   * 添加课程信息
   * @param data
   */
  addCourse(data) {
    return request({
      url: `/edu-service/course/add`,
      method: 'post',
      data
    })
  },
  /**
   * 更新课程信息
   * @param data
   */
  updateCourse(data) {
    return request({
      url: `/edu-service/course/update`,
      method: 'post',
      data
    })
  },
  /**
   * 查询课程信息
   * @param data
   */
  queryCourseInfo(id) {
    return request({
      url: `/edu-service/course/${id}`,
      method: 'get'
    })
  }

}